package reflect;

import reflect.annotations.AutoRunClass;
import reflect.annotations.AutoRunMethod;

@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 18;
    public Person(){}

    public Person(String name) {
        this.name = name;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    @AutoRunMethod(count=4)
    public void play(){
        System.out.println(name+"玩游戏");
    }
    @AutoRunMethod(count=2)
    public void eat(){
        System.out.println(name+"吃");
    }
    public void watchTV(){
        System.out.println(name+"看电视");
    }
    @AutoRunMethod(count=5)
    public void sayHi(){
        System.out.println(name+"打招呼");
    }
    public void say(String info){
        System.out.println(name+"说："+info);
    }
    public void say(String info,int count){
        for (;count>0;count--){
            System.out.println(name+"说："+info);
        }
    }
    private void heihei(){
        System.out.println("我是Person的私有成员");
    }
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
